package cn.shotsapp.shots.account.presenter;

import cn.shotsapp.shots.account.contract.LoadingContract;
import cn.shotsapp.shots.data.account.repository.IAccountRepository;

/**
 * Created by YZQ on 2016/12/1.
 */

public class LoadingPresenter implements LoadingContract.Presenter {
    private LoadingContract.View mView;
    private IAccountRepository mAccountRepository;

    public LoadingPresenter(LoadingContract.View mView, IAccountRepository mAccountRepository) {
        this.mView = mView;
        this.mAccountRepository = mAccountRepository;
    }

    @Override
    public void skipAfterLoading() {
        if (!mAccountRepository.available()) {
            mAccountRepository.requestTrialAccount(null);
        }
        mView.switchToStory();
    }
}
